package me.ereach.streams;

import java.util.List;

public class Main {
    public static void main(String[] args) {
        List<User> list = List.of(
                new User("Tom", "male", 10),
                new User("Jerry", "male", 12),
                new User("Cherry", "male", 8),
                new User("Wendy", "male", 9)
        );

        list.stream()
                .forEach(user -> System.out.println(user));

        System.out.println("===");
        list.stream()
                .map(movie -> movie.getName())
                .forEach(n -> System.out.println(n));

        System.out.println("===");
        list.stream()
                .limit(2)
                .forEach(n -> System.out.println(n));
    }
}
